package xin.javashare.designPattern.creation.factoryMethod;

import xin.javashare.designPattern.creation.factoryMethod.service.Sender;
import xin.javashare.designPattern.creation.factoryMethod.service.serviceImp.MailSender;
import xin.javashare.designPattern.creation.factoryMethod.service.serviceImp.SmsSender;

/**
 * 工厂类
 * 工厂方法模式   之   多个工厂方法模式
 */
public class MulSendFactory {
    // 工厂方法1
    public Sender produceMail(){
        return new MailSender();
    }
    // 工厂方法2
    public Sender produceSms(){
        return new SmsSender();
    }


    // 测试
    public static void main(String[] args) {
        MulSendFactory factory = new MulSendFactory();
        Sender sender = factory.produceMail();
        sender.Send();
    }
}
